/**
 * 
 */
package STUDENTS.TRANVANCHO.Sources.EXCER;

import java.util.Scanner;

/**
 * @author TRAN VAN CHO
 *
 */
public class baitoan2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
	
		//moi nhap so a
		String strTemp="";
		Scanner sc= new Scanner(System.in);
	
		do{
			System.out.println("moi nhap so a");
			strTemp = sc.nextLine();
		}while(strTemp.isEmpty());
		//
		double dNuma=Double.parseDouble(strTemp);
		//moi nhap so b
		do{
			System.out.println("moi nhap so b");
			strTemp = sc.nextLine();
		}while(strTemp.isEmpty());
		double dNumb=Double.parseDouble(strTemp);
		
	
	//moi cho phep tinh toan
		
		do{
	System.out.println("moi chon: 0-cong;1-tru;2-nhan;3-chia");
		strTemp=sc.nextLine();
		}while(strTemp.isEmpty()
				||Integer.parseInt(strTemp)<0
				||Integer.parseInt(strTemp)>3);
				
		byte b0pt=Byte.parseByte(strTemp);
		//kiem tra tinh toan
		switch(b0pt){
		case 0: System.out.println("a+b="+(dNuma+dNumb));break;
		case 1: System.out.println("a-b="+(dNuma-dNumb));break;
		case 2: System.out.println("a*b="+(dNuma+dNumb));break;
		case 3:
			if(dNumb==0)
			System.out.println("phep toan khong thu hien");
			else
				System.out.println("a/b="+(dNuma/dNumb));
			break;	
			default:
				System.out.println("phep tinh khong hop le");
			
		}
	
	}}
	

